﻿#include "dbcontroller.h"
#include <QJsonObject>
#include <QJsonDocument>

DBController::DBController(QObject* parent):HttpRequestHandler(parent)
{
    // empty
}

void DBController::service(HttpRequest &request, HttpResponse &response)
{
//    response.write("Hello World",true);

    QJsonObject object,objdata;
    objdata.insert("token","admin");
    object.insert("code",200);
    object.insert("flag",true);
    object.insert("message",QStringLiteral("验证成功!"));
    object.insert("data",objdata);

    response.write(QJsonDocument(object).toJson(),true);
}
